import Https from '@/utils/https'

// 保存目录
const saveDir = (params) => Https.post('/api/v1/offlineDev/dir/save', params, { json: false })
// 删除节点，支持所有节点类型
const deleteTask = (params) => Https.post('/api/v1/offlineDev/node/delete', params, { json: false })
// 获取目录树
const getDirTree = (params) => Https.get('/api/v1/offlineDev/dir/tree', params)
// 移动节点至其他目录
const devDirChange = (params) => Https.post('/api/v1/offlineDev/dir/change', params, { json: false })
// 获取资源选项列表
const listResource = () => Https.get('/api/v1/offlineDev/resource/tree')
// 保存函数
const saveFunction = (params) => Https.post('/api/v1/offlineDev/function/save', params, { json: false })
// 获取目录树
const getTrees = (params) => Https.get('/api/v1/offlineDev/node/listAll', params)
// 获取函数详情
const getFunctionDetail = (params) => Https.get('/api/v1/offlineDev/function/detail', params)

export {
  saveDir, deleteTask, getDirTree, devDirChange, listResource, saveFunction, getTrees, getFunctionDetail,
}
